home *** CD-ROM | disk | FTP | other *** search
- _root.frameaction = function()
- {
- var _loc1_ = this;
- switch(action)
- {
- case "player stops jetpacing":
- jetpac.play();
- if(jetd == 100)
- {
- p1rot = - random(90);
- }
- else
- {
- p1rot = random(90) + 180;
- }
- if(turn == "player1")
- {
- attachMovie("playertype2","player1",10);
- p1x = hitx;
- p1y = hity;
- if(jetd == 100)
- {
- p1rot = - random(90);
- }
- else
- {
- p1rot = random(90) + 180;
- }
- }
- else
- {
- attachMovie("playertype2","player2",11);
- p2x = hitx;
- p2y = hity;
- p2rot = 90;
- if(jetd == 100)
- {
- p2rot = - random(90);
- }
- else
- {
- p2rot = random(90) + 180;
- }
- }
- player2.gunturretindicator._visible = false;
- player1.gunturretindicator._visible = false;
- rotateplayers();
- action = "end turn";
- break;
- case "jetpacing player":
- startplayerjetpac();
- break;
- case "wait for jetpacing player":
- jetpacing();
- break;
- case "announce round":
- gamemessage2 = "Round " + round;
- attachMovie("tellplayeralt","tellplayeralt",21);
- tellplayeralt._y = 300;
- tellplayeralt._x = 400;
- wait = 0;
- action = "wait for round announce message";
- break;
- case "wait for round announce message":
- wait++;
- if(wait > 60)
- {
- tellplayeralt.play();
- a = random(2) + 1;
- if(a == 1)
- {
- turn = "player1";
- action = "tell player ones move";
- }
- else
- {
- turn = "player2";
- action = "tell player twos move";
- }
- rotateplayers();
- }
- break;
- case "test for game over":
- if(player1score >= 2)
- {
- gotoAndStop(122);
- winner = player1name;
- loser = player2name;
- }
- else if(player2score >= 2)
- {
- gotoAndStop(122);
- winner = player2name;
- loser = player1name;
- }
- else
- {
- action = "Start new round";
- }
- break;
- case "Start new round":
- startnewround();
- action = "announce round";
- break;
- case "test for win":
- wait = 0;
- if(player1health <= 0)
- {
- roundwinnername = player2name;
- action = "tell player they have won";
- player2score++;
- round++;
- break;
- }
- if(player2health <= 0)
- {
- roundwinnername = player1name;
- action = "tell player they have won";
- player1score++;
- round++;
- break;
- }
- if(turn == "player1")
- {
- turn = "player2";
- action = "tell player twos move";
- }
- else
- {
- turn = "player1";
- action = "tell player ones move";
- }
- break;
- case "tell player they have won":
- gamemessage = roundwinnername + " wins this round!";
- attachMovie("tellplayerwin","tellplayer",20);
- tellplayer._y = 300;
- tellplayer._x = 400;
- action = "wait for round won message";
- break;
- case "wait for round won message":
- wait++;
- if(wait > 60)
- {
- tellplayer.play();
- turn = "player1";
- action = "test for game over";
- }
- break;
- case "wait for message":
- wait++;
- if(wait > 60)
- {
- tellplayer.play();
- if(turn == "player1")
- {
- action = "player ones move";
- }
- else
- {
- action = "player twos move";
- }
- }
- break;
- case "tell player ones move":
- _loc1_.player1healthind.playeronesmoney.gotoAndstop(1);
- _loc1_.player2healthind.playertwosmoney.gotoAndstop(2);
- attachMovie("weaponselector","weaponselector",16);
- weaponselector._x = 400;
- weaponpress(player1bombtype);
- windchange();
- player1.gunturretindicator._visible = true;
- player2.gunturretindicator._visible = false;
- player1.marker.gotoAndPlay(2);
- player2.marker.gotoAndStop(1);
- wait = 0;
- gamemessage = player1name + "\'s turn";
- attachMovie("tellplayer","tellplayer",20);
- tellplayer._y = 300;
- tellplayer._x = 400;
- action = "wait for message";
- break;
- case "tell player twos move":
- _loc1_.player1healthind.playeronesmoney.gotoAndstop(2);
- _loc1_.player2healthind.playertwosmoney.gotoAndstop(1);
- attachMovie("weaponselector","weaponselector",16);
- weaponselector._x = 400;
- weaponpress(player2bombtype);
- windchange();
- player2.gunturretindicator._visible = true;
- player1.gunturretindicator._visible = false;
- missleselector._y = 7.7;
- player2.marker.gotoAndPlay(2);
- player1.marker.gotoAndStop(1);
- wait = 0;
- gamemessage = player2name + "\'s turn";
- attachMovie("tellplayer","tellplayer",20);
- tellplayer._y = 300;
- tellplayer._x = 400;
- action = "wait for message";
- break;
- case "player ones move":
- keytest();
- break;
- case "player twos move":
- keytest();
- break;
- case "movebomb":
- movebomb();
- break;
- case "explode bomb":
- explodebomb();
- break;
- case "animate explosion":
- animateExplosion();
- break;
- case "end turn":
- action = "test for win";
- }
- };
-